package com.shelpe.services.sinbad.controller.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.shelpe.services.sinbad.entity.jpa.Tactics;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "卡位")
public class RankingDto extends RankItem {
	@JsonProperty("executions")
	private long exeCount;// 有效执行次数
	@JsonProperty("tactics_modified_time")
	@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	private String lastModifiedTime;// 有效上一次修改时间
	@JsonProperty("is_adgroup_exist")
	private boolean adgroupExist;
	
	@JsonProperty("want_rank")
	private Integer wantRank;//期望排名

	@Override
	public void from(Tactics po) {
		super.from(po);
		this.setExeCount(po.getValidExecutions());
		
	}

	@Override
	public Tactics to() {
		Tactics tactics = super.to();
		return tactics;
	}
}
